package com.youzhong.controller;

import java.util.ArrayList;
import java.util.concurrent.Executors;
import java.util.function.Consumer;
import java.util.stream.Stream;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {
	
	
	@RequestMapping("index")
	@ResponseBody
	public String index() {
		return "index";
	}
	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		long aa = 1555999200000l;
		long bb = 1556010417767l;
		
		
		long time = (aa-bb)% (1000l*60l*10l) + 1000l*60l*10l;
		System.out.println(time);
		System.out.println(1000*60*60*24);
		/*
		 * System.out.println(Math.round(100.05) - Math.floor(100.03));
		 * System.out.println(Math.ceil(100.05) - Math.round(-100.05));
		 */
		/*test[] values = test.values();
		for (test test2 : values) {
			System.out.println(test2);
			System.out.println(test2.name());
			System.out.println(test2.ordinal());
		}
		test valueOf = test.valueOf(test.class, "MUM");
		System.out.println("================================");
		System.out.println(valueOf);
		valueOf.setId(1);
		valueOf.setName("zhangsan");
		valueOf.setAge(20);
		valueOf.setSex("nan");
		System.out.println(valueOf.toString());*/
		/*ExecutorService service = Executors.newCachedThreadPool();
		for (int i = 0; i < 10; i++) {
			
			service.execute(()->{
				test mTest = test.MUM;
				System.out.println(mTest.toString());
			});
		}*/
		/*String ss = "666666";
		String aa = "^(\\d)\\1{5}$";
		boolean matches = !ss.matches(aa);
		System.out.println(matches);
		Pattern compile = Pattern.compile(aa);
		Matcher matcher = compile.matcher(ss);
		
		while (matcher.find()) {
			System.out.println(matcher.group());
			
		}*/
		
		/*
		 * String ss = "●★☆№▲※＆＠睡觉 晚安 睡了 碎觉爱你 飞吻 么么哒嘿嘿 苦笑 呲牙 强颜欢笑 憨笑"; String string =
		 * Base64.getEncoder().encodeToString(ss.getBytes()); byte[] decode =
		 * Base64.getDecoder().decode(string); try { String sss = new
		 * String(decode,"UTF-8"); System.out.println(sss); } catch
		 * (UnsupportedEncodingException e) { // TODO Auto-generated catch block
		 * e.printStackTrace(); }
		 */
		/*
		 * String ss = "123"; String[] split = ss.split(",");
		 * System.out.println(split.length); System.out.println(split[0]);
		 */
	}
	
	
	
}
enum test {
	MUM,asl,wod,tade,els;
	private String name;
	private Integer id;
	private String sex;
	private Integer age;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	/*public String toString() {
		return "id : " + this.getId() + ",name :" + this.getName() + ",sex :" + this.getSex() + ",age :" + this.getAge();
	}*/
	
}

class mstest{
	public static void changestr(String str){
		str += "welcome";
		str.toString();
	}
	public static  void changeobject(objectclass object){
		object = new objectclass("welcome");
	}
	
	public static void main(String[] args) {
		String str = "123455";
		changestr(str);
		System.out.println("stringvalue:" + str);
        objectclass objectclass = new objectclass(str);
        changeobject(objectclass);
        System.out.println(objectclass.value);
        
        new Runnable() {
			public void run() {
				
			}
		};
		new Thread(System.out::println).start();
		Runnable run = Math::random;
		new Runnable() {
			public void run() {
				Math.random();
			}
		};
		
    }
}

class objectclass{
	String value = null;
	public objectclass (final  String value){
		this.value = value;
	}
	public static void main(String[] args) {
		//new Thread(objectclass::print).start();
		Class<? extends Stream> class1 = new ArrayList<>().stream().getClass();
		System.out.println(class1);
	}
	public static void print() {
		System.out.println("ninhao ");
	}
}
